package cn.antank.sdk.constant;

import org.apache.commons.lang3.StringUtils;

public class PayStatus {
	
	//1，业务订单状态
	public static final String STATUS_NEW = 			"new";					//1.1 新订单
	public static final String STATUS_PAID_CERTAIN =	"paid_certain";			//3.3 订单支付成功，金额、优惠、扣款等无误
	public static final String STATUS_PAID_SUCCESS =	"paid_success";			//4 订单成交：库存,扣款,发货等都无问题

	public static final String STATUS_PAID_FAILURE =	"paid_failure";			//3.2 订单支付成功，但出票失败

	public static final String STATUS_PAID_RETURN_SUCC ="paid_return_succ"; 	//5.1 成交的订单退款
	public static final String STATUS_PAID_RETURN_CERTAIN ="paid_return_cert";	//5.3 金额验证成功退款
	public static final String STATUS_PAID_RETURN_FAIL ="paid_return_fail";		//5.2 金额验证失败退款

	//2，用于查询的额外状态
	public static final String STATUS_PAID 		= "paid";	//付款订单
	public static final String STATUS_CANCEL 	= "cancel";	//取消订单
	
	public static final boolean isPaid(String status) {
		return StringUtils.startsWith(status, STATUS_PAID);
	}

	public static final boolean isCancel(String status) {
		return StringUtils.startsWith(status, STATUS_CANCEL);
	}

	public static final boolean isNew(String status) {
		return StringUtils.startsWith(status, STATUS_NEW);
	}

	public static final boolean isPaidSuccess(String status) {
		return StringUtils.startsWith(status, STATUS_PAID_SUCCESS);
	}
}
